<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org">

<head>
    <th:block th:include="include :: header('首页')" />
</head>

<body class="fixed-sidebar full-height-layout gray-bg" style="overflow:hidden">
    <div id="wrapper">
        <!--左侧导航开始-->
        <nav class="navbar-default navbar-static-side" role="navigation">
            <div class="nav-close"><i class="fa fa-times-circle"></i>
            </div>
            <div class="sidebar-collapse">
                <ul class="nav" id="side-menu">
                    <li class="nav-header">
                        <div class="dropdown profile-element">
                            <a data-toggle="dropdown" class="dropdown-toggle" href="#">
                                <span class="clear">
                                    <span class="block m-t-xs" style="font-size:20px;">
                                        <i class="fa fa-area-chart"></i>
                                        <strong class="font-bold">Tdy</strong>
                                    </span>
                                </span>
                            </a>
                        </div>
                        <div class="logo-element">Tdy
                        </div>
                    </li>
                    <li class="line dk"></li>
                    <div class="user-panel">
                        <a>
                            <div class="hide">个人中心</div>
                            <div class="pull-left image">
                                <img src="/img/profile.jpg" onerror="this.src='img/profile.jpg'" style="width: 60px;height: 40px" class="img-circle" alt="User Image">
                            </div>
                        </a>
                        <div class="pull-left info">
                            <p style="padding-left:5px;">admin</p>
                            <a href="#"><i class="fa fa-circle text-success" style="padding-left:10px;"></i> 在线</a>
                            <a href="logout" style="padding-left:15px;"><i class="fa fa-sign-out text-danger"></i> 注销</a>
                        </div>
                    </div>
                    <li class="line dk"></li>
                    <li>
                        <a class="J_menuItem" href="home">
                            <i class="fa fa-home"></i>
                            <span class="nav-label">主页</span>
                        </a>
                    </li>

                    <!--菜单开始-->
                    <li th:each="item:${menuTree}">
                        <a th:href="${item.url}=='#'?'#':${item.url}">
                            <i class="fa fa fa-bar-chart-o"></i>
                            <span class="nav-label" th:text="${item.name}"></span>
                            <span class="fa arrow"></span>
                        </a>
                        <ul class="nav nav-second-level" th:each="item1:${item.children}">
                            <li th:if="${item1.url=='#'}">
                                <a href="#"><text th:text="${item1.name}"></text><span class="fa arrow"></span></a>
                                <ul class="nav nav-third-level" th:each="item2:${item1.children}">
                                    <li>
                                        <a class="J_menuItem" th:href="${item2.url}" th:text="${item2.name}"></a>
                                    </li>
                                </ul>
                            </li>
                            <li th:if="${item1.url!='#'}">
                                <a class="J_menuItem" th:href="${item1.url}" th:text="${item1.name}"></a>
                            </li>
                        </ul>
                    </li>
                    <!--菜单结束-->




                </ul>
            </div>
        </nav>
        <!--左侧导航结束-->




        <!--右侧部分开始-->
        <div id="page-wrapper" class="gray-bg dashbard-1">
            <div class="row border-bottom">
                <nav class="navbar navbar-static-top" role="navigation" style="margin-bottom: 0">
                    <div class="navbar-header">
                        <a class="navbar-minimalize minimalize-styl-2 btn btn-info " href="#"><i class="fa fa-bars"></i> </a>
                    </div>
                    <ul class="nav navbar-top-links navbar-right">
                        <li class="dropdown">
                            <a class="dropdown-toggle count-info" data-toggle="dropdown" onclick="logout()">
                                <i class="fa fa-sign-out text-danger"></i> 退出登录<span class="label label-warning"></span>
                            </a>
                    </ul>
                </nav>
            </div>
            <div class="row J_mainContent" id="content-main">
                <iframe id="J_iframe" width="100%" height="100%" src="home" frameborder="0" data-id="index_v1.html" seamless></iframe>
            </div>
        </div>
        <!--右侧部分结束-->
    </div>

    <th:block th:include="include :: index" />
    <script th:inline="javascript">
        function logout() {
            $.ajax({ url: "/logout", success: function(result){
                    if(result.code == 0){
                        location.href = "/";
                    }else{
                        console.log(result)
                        alert(result.msg);
                    }
                }});
        }
    </script>
</body>

</html>
